package com.beiding.workordersystem.common.utils;

import java.util.Random;

public class RandomUtils {
    private static final char[] chars = new char[62];

    static {
        for (int i = 0; i < 26; i++) {
            chars[i] = (char) ('a' + i);
        }

        for (int i = 0; i < 26; i++) {
            chars[i + 26] = (char) ('A' + i);
        }

        for (int i = 0; i < 10; i++) {
            chars[i + 52] = (char) ('0' + i);
        }
    }
    private static Random random = new Random();
    public static String createRandomString(int len) {
        StringBuilder builder = new StringBuilder();

        for (int i = 0; i < len; i++) {
            builder.append(chars[random.nextInt(62)]);
        }
        return builder.toString();
    }

}
